<?php

require_once '_header.php';

?>
<!--<div class="task_item">
    <img class="notification_image" alt="Keira Knightley" src="http://wallpaper.pickywallpapers.com/ipad2/preview/penelope-cruz-with-messed-hair.jpg" />
    <div class="notification_title">Titel</div>
    <div class="notification_content">Beschreibung</div>
    <div class="notification_info">Informationen</div>
</div>-->

<?php

// First show upcoming tasks
$dao = new TaskDAO();
$tasks = $dao->getCurrent(false, false);

echo '<h2>Fällige Aufgaben</h2>';

foreach($tasks as $task){
    TaskView::display($task);
}

if(count($tasks) < 1){
    echo '<div class="msg info">Im Moment gibt es keine Aufgaben.<br />Du kannst dir <a href="tasks.php">alle Aufgaben ansehen.</a></div>';
}


// Notifications

$dao = new NotificationDAO();
$notifications = $dao->getAll();

echo '<h2>Neue Mitteilungen</h2>';

foreach($notifications as $task){
    NotificationView::display($task);
}

if(count($notifications) < 1){
    echo '<div class="msg info">Im Moment gibt es keine aktuellen Mitteilungen.<br />Du kannst dir <a href="notifications.php">alle Mitteilungen ansehen.</a></div>';
}

require_once '_footer.php';

?>